package com.panfeng.xcloud.boss.provider.member.service.impl;

import com.panfeng.xcloud.boss.provider.member.dao.mapper.WalletAssetsMapperExt;
import com.panfeng.xcloud.boss.provider.member.enums.WalletAssetsTypeEnum;
import com.panfeng.xcloud.boss.provider.member.service.IWalletAssetsService;
import com.panfeng.xcloud.common.core.enums.CoinTypeEnum;
import com.panfeng.xcloud.dao.assets.entity.WalletAssets;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class WalletAssetsServiceImpl implements IWalletAssetsService {

    @Autowired
    private WalletAssetsMapperExt walletAssetsMapperExt;

    @Override
    public void createWalletAssets(String userId) {
        for (WalletAssetsTypeEnum value : WalletAssetsTypeEnum.values()) {
            WalletAssets walletAssets = new WalletAssets();
            walletAssets.setUserId(userId);
            walletAssets.setCoin(CoinTypeEnum.USDT.getCode());
            walletAssets.setAssetType(value.code);
            walletAssetsMapperExt.insertSelective(walletAssets);
        }
    }

}
